<?php 
/**
 * [PHPFOX_HEADER]
 * 
 * @copyright		[PHPFOX_COPYRIGHT]
 * @author  		Raymond_Benc
 * @package 		Phpfox
 * @version 		$Id: controller.html.php 64 2009-01-19 15:05:54Z Raymond_Benc $
 */
 
defined('PHPFOX') or exit('NO DICE!'); 

?>
{*
<div class="profile_image">
    <div class="profile_image_holder">
		{if $aPage.is_app}
		{img server_id=0 path='app.url_image' file=$aPage.aApp.image_path suffix='_200' max_width='175' max_height='300' title=$aPage.aApp.app_title}
		{else}
		{img thickbox=true server_id=$aPage.image_server_id title=$aPage.title path='pages.url_image' file=$aPage.image_path suffix='_200' max_width='175' max_height='300'}
		{/if}
	</div>
</div>*}
{if isset($bCanViewPage) && $bCanViewPage}
<div class="sub_section_menu pages_view_menu">
	<ul>		
		{foreach from=$aPageLinks item=aPageLink}
			<li class="{if isset($aPageLink.is_selected)} active{/if}">
				<a href="{$aPageLink.url}" class="ajax_link">{$aPageLink.phrase}{if isset($aPageLink.total)}<span>({$aPageLink.total|number_format})</span>{/if}</a>				
				{if isset($aPageLink.sub_menu) && is_array($aPageLink.sub_menu) && count($aPageLink.sub_menu)}
				<ul>
				{foreach from=$aPageLink.sub_menu item=aProfileLinkSub}
					<li class="{if isset($aProfileLinkSub.is_selected)} active{/if}"><a href="{url link=$aPageLink.url}{$aProfileLinkSub.url}">{$aProfileLinkSub.phrase}{if isset($aProfileLinkSub.total) && $aProfileLinkSub.total > 0}<span class="pending">{$aProfileLinkSub.total|number_format}</span>{/if}</a></li>
				{/foreach}
				</ul>
				{/if}				
			</li>
		{/foreach}
	</ul>
        {if !Phpfox::isMobile() && (Phpfox::getUserParam('pages.can_moderate_pages') || $aPage.is_admin)}
        <div class="pages_setting">
            <div class="item_bar">
                    <div class="item_bar_action_holder">
                            {if $aPage.view_id == '1' && Phpfox::getUserParam('pages.can_moderate_pages')}
                                    <a href="#" class="item_bar_approve item_bar_approve_image" onclick="return false;" style="display:none;" id="js_item_bar_approve_image">
                                            {img theme='ajax/add.gif'}
                                    </a>			
                                    <a href="#" class="item_bar_approve" onclick="$(this).hide(); $('#js_item_bar_approve_image').show(); $.ajaxCall('pages.approve', 'page_id={$aPage.page_id}'); return false;">
                                            {phrase var='pages.approve'}
                                    </a>
                            {/if}		
                            <a href="#" class="item_bar_action">
                                    <span>
                                            Settings
                                    </span>
                            </a>		
                            <ul>
                                    {template file='pages.block.link'}
                            </ul>
                    </div>		
            </div>
            {if $aPage.is_group == 0}
            <div class="pages_view_search"><a href="#"></a></div>
            {else}
                {if !Phpfox::getUserBy('profile_page_id') && Phpfox::isUser()}
                    {if $aPage.reg_method == '2' && !isset($aPage.is_invited) && $aPage.page_type == '1'}
                    {else}
                            {if isset($aPage.is_reg) && $aPage.is_reg}
                            {else}
                                    <span id="pages_like_join_position"{if $aPage.is_liked} style="display:none;"{/if}>
                                            <a href="#" id="pages_like_join" onclick="$(this).parent().hide(); $('#js_add_pages_unlike').show(); {if $aPage.page_type == '1' && $aPage.reg_method == '1'} $.ajaxCall('pages.signup', 'page_id={$aPage.page_id}'); {else}$.ajaxCall('like.add', 'type_id=pages&amp;item_id={$aPage.page_id}');{/if} return false;">
                                                    {if $aPage.page_type == '1'}
                                                            {phrase var='pages.join'}
                                                    {else}
                                                            {phrase var='pages.like'}
                                                    {/if}
                                            </a>
                                    </span>
                            {/if}
                    {/if}
            {/if}
            {/if}
        </div>
        {/if}

        {if !Phpfox::getUserBy('profile_page_id') && Phpfox::isUser()}
                {if $aPage.reg_method == '2' && !isset($aPage.is_invited) && $aPage.page_type == '1'}
                {else}
                        {if isset($aPage.is_reg) && $aPage.is_reg}
                        {else}
                                <span id="pages_like_join_position" class="like_join_position"{if $aPage.is_liked} style="display:none;"{/if}>
                                        <a href="#" id="pages_like_join" onclick="$(this).parent().hide(); $('#js_add_pages_unlike').show(); {if $aPage.page_type == '1' && $aPage.reg_method == '1'} $.ajaxCall('pages.signup', 'page_id={$aPage.page_id}'); {else}$.ajaxCall('like.add', 'type_id=pages&amp;item_id={$aPage.page_id}');{/if} return false;">
                                                {if $aPage.page_type == '1'}
                                                        {phrase var='pages.join'}
                                                {else}
                                                        {phrase var='pages.like'}
                                                {/if}
                                        </a>
                                </span>
                        {/if}
                {/if}
        {/if}
    <div class="clear"></div>
</div>
{/if}